#include<stdio.h>
#include<stdlib.h>

#define MAXSIZE 10
#define Notfound 0
typedef int ElementType;

typedef int Position;
typedef struct LNode *List;
struct LNode{
    ElementType Data[MAXSIZE];
    Position Last;
};

List ReadInput();//元素从下标1开始存储
Position BinarySearch(List L, ElementType X);

int main()
{
    List L;
    ElementType X;
    Position P;

    L = ReadInput();
    scanf("%d", &X);
    P = BinarySearch(L, X);
    printf("%d\n", P);

    return 0;
}

List ReadInput()
{
    List p = (List)malloc(sizeof(struct LNode));
    scanf("%d", &p->Last);
    for (int i = 1; i <= p->Last;i++)
    {
        scanf("%d", &p->Data[i]);
    }
    return p;
}

Position BinarySearch(List L,ElementType X)
{
    int right, left,mid;
    int sz = sizeof(L->Data) / sizeof(L->Data[0]);
    left = 1, right = sz - 1;
    while(left < right)
    {
        mid = (left + right) / 2;
        if(L->Data[mid] < X)
        {
            left = mid + 1;
        }
        else if(L->Data[mid] > X)
        {
            right = mid - 1;
        }
        else
        {
            return mid;
        }
    }
    return Notfound;
}
